# Contributor: Kevin Wang <kevin@muxable.com>
# Maintainer: Kevin Wang <kevin@muxable.com>
pkgname=librist
pkgver=0.2.6
pkgrel=1
pkgdesc="Reliable Internet Stream Transport (RIST)"
url="https://www.rist.tv/"
arch="all"
license="BSD-2-Clause"
makedepends="meson linux-headers cjson-dev mbedtls-dev"
checkdepends="cmocka-dev"
subpackages="$pkgname-progs $pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://code.videolan.org/rist/librist/-/archive/v$pkgver/librist-v$pkgver.tar.gz"
builddir="$srcdir/librist-v$pkgver"

build() {
	abuild-meson build
	meson compile ${JOBS:+-j ${JOBS}} -C build
}

check() {
	case "$CARCH" in
	ppc64le|arm*|s390x|aarch64)
		# tests fail
		;;
	*)
		meson test --no-rebuild -v -C build
		;;
	esac
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C build
}

progs() {
	pkgdesc="Tools for working with RIST"
	depends=""
	amove usr/bin
}

sha512sums="feef30219c6e6ad86229f7b069afb9f556e1f976a6b8a3e00473364808971da2155ea8a1bb2ff808f6218481f002910b8646f3194f2e9f272d110c15e64608a1  librist-0.2.6.tar.gz"
